<?php
/**
 * Created by PhpStorm.
 * User: Eric-Nothing
 * Date: 2018/4/28
 * Time: 15:24
 */

namespace app\api\controller\v1;



class Base
{
    public function success($ret = [],$code = 0,$msg = '操作成功'){

        return json([
            'code'=>$code,
            'ret'=>$ret,
            'msg'=>$msg
        ]);

    }

    public function error($msg = '操作失败',$code = -1){

        return json([
            'code'=>$code,
            'msg'=>$msg
        ]);
    }

}